package com.ruoyi.xh.service.impl;

import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.xh.mapper.XhAdminPicMapper;
import com.ruoyi.xh.domain.XhAdminPic;
import com.ruoyi.xh.service.IXhAdminPicService;

/**
 * 图库Service业务层处理
 * 
 * @author songjw
 * @date 2024-12-13
 */
@Service
public class XhAdminPicServiceImpl extends ServiceImpl<XhAdminPicMapper,XhAdminPic> implements IXhAdminPicService {

    /**
     * 查询图库
     * 
     * @param id 图库主键
     * @return 图库
     */
    @Override
    public XhAdminPic selectXhAdminPicById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询图库列表
     * 
     * @param xhAdminPic 图库
     * @return 图库
     */
    @Override
    public Page<XhAdminPic> selectXhAdminPicList(XhAdminPic xhAdminPic)
    {
        return new Page<>();
    }

    /**
     * 新增图库
     * 
     * @param xhAdminPic 图库
     *
     */
    @Override
    public void insertXhAdminPic(XhAdminPic xhAdminPic)
    {
        this.save(xhAdminPic);
    }

    /**
     * 修改图库
     * 
     * @param xhAdminPic 图库
     *
     */
    @Override
    public void updateXhAdminPic(XhAdminPic xhAdminPic)
    {
        this.updateById(xhAdminPic);
    }

    /**
     * 批量删除图库
     * 
     * @param ids 需要删除的图库主键
     *
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteXhAdminPicByIds(Long[] ids)
    {
        this.removeByIds(Stream.of(ids).collect(Collectors.toSet()));
    }
}
